<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCheckFilesTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('check_files', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('date')->default(0)->comment('日期');
            $table->unsignedInteger('payChannel')->default(0)->comment('支付渠道');
            $table->unsignedInteger('sysType')->default(0)->comment('业务类型');
            $table->string('urlPath', 255)->default('')->comment('oss的path');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('1删除');

            $table->index('date', 'idxDate');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '对账 - 对账文件oss地址';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('check_files');
    }
}
